#include <iostream>

using namespace std;

//set a default param
void test(int a = 10)
{
    cout << "a = " << a << endl;
}

//default param define from right to left
void test1(int a, int b, int c = 10, int d = 1)
{
    cout << "a = " << a << endl;
    cout << "b = " << b << endl;
    cout << "c = " << c << endl;
    cout << "d = " << d << endl;
}

//defualt param and overload
void test2();                       //need 0 param
void test2(int a);                  //need 1 param
void test2(int a, int b);           //need 2 param
void test2(int a = 0, int b = 0);   //need 0~2 param

//needed param number cannot bettwen overload function param number
void test3(int x);              //need 1 param
void test3(int x, int y = 10);  //need 0~1 param

//test3(10); //error

int main()
{
    test();
    //if set a exact param, default param will lapse
    test(100);

    //exact param matching from left to right
    test1(1000, 100);

    return 0;
}

